package com.msb.mallcart.Config;

import com.msb.mallcart.Interceptor.AuthInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Auther: xixifeng
 * @Date: 2022/11/10 - 11 - 10 - 18:29
 * @Description: com.msb.mallcart.Config
 * @version: 1.0
 */

//注册拦截器
@Configuration
public class MyWebInterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new AuthInterceptor()).addPathPatterns("/**");


    }
}
